﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.ExtPub.Models
{
    /// <summary>
    /// 我的审批列表请求信息
    /// </summary>
    public class ReqMyApprovalList : BasePageingRequest
    {
        /// <summary>
        /// 
        /// </summary>
        public string openid { get; set; } = "";
        /// <summary>
        /// 
        /// </summary>
        public string unionid { get; set; } = "";
        /// <summary>
        /// 审批标志：N-待审；Y-已审
        /// </summary>
        [Required(ErrorMessage = "审批标志是必需的")]
        public string revlb { get; set; } = "";
        /// <summary>
        /// 人员id
        /// </summary>
        public int personid { get; set; }
        /// <summary>
        /// 公司代码
        /// </summary>
        public string comcd { get; set; } = "";
        /// <summary>
        /// 审批类别：空值=所有
        /// </summary>
        public string applytp { get; set; } = "";
    }
    /// <summary>
    /// 我的审批列表结果集
    /// </summary>
    public class ResultMyApprovalList : BaseResultInfoPaging
    {
        /// <summary>
        /// 审批摘要列表
        /// </summary>
        public List<MyApprovalSummary> approvallist { get; set; } = new List<MyApprovalSummary>();
    }
    /// <summary>
    /// 我的审批摘要信息
    /// </summary>
    public class MyApprovalSummary
    {
        /// <summary>
        /// 申请单id
        /// </summary>
        public int applyid { get; set; }
        /// <summary>
        /// 申请单类别
        /// </summary>
        public string applytp { get; set; } = "";
        /// <summary>
        /// 申请单标题
        /// </summary>
        public string applytpnm { get; set; } = "";
        /// <summary>
        /// 处理方式：R；P
        /// </summary>
        public string hdltp { get; set; } = "";
        /// <summary>
        /// 处理方式说明
        /// </summary>
        public string hdltpnm { get; set; } = "";
        /// <summary>
        /// 所属公司代码
        /// </summary>
        public string comcd { get; set; } = "";
        /// <summary>
        /// 申请金额
        /// </summary>
        public string amt_apply { get; set; } = "";
        /// <summary>
        /// 申请单描述（对应账单类别描述）
        /// </summary>
        public string desc { get; set; } = "";
        /// <summary>
        /// 申请人
        /// </summary>
        public string creator { get; set; } = "";
        /// <summary>
        /// 申请时间
        /// </summary>
        public string submitdt { get; set; } = "";
    }

    /// <summary>
    /// 审批详情请求
    /// </summary>
    public class ReqApprovalDetail : BaseWxUserRequest
    {
        /// <summary>
        /// 申请单id
        /// </summary>
        public int applyid { get; set; }
        /// <summary>
        /// 申请单类别：BILL；FN
        /// </summary>
        public string applytp { get; set; } = "";
        /// <summary>
        /// 审批标志：Y；N
        /// </summary>
        public string revlb { get; set; } = "";
    }
    /// <summary>
    /// 审批单所属的账单明细请求
    /// </summary>
    public class ReqApprovalBillDetail : BaseWxUserRequest
    {
        /// <summary>
        /// 账单id
        /// </summary>
        [Required]
        public int billid { get; set; }
    }

    /// <summary>
    /// 审批详情结果集
    /// </summary>
    public class ResultApprovalDetail : BaseResultInfo
    {
        /// <summary>
        /// 申请单id
        /// </summary>
        public int applyid { get; set; }
        /// <summary>
        /// 申请单类别：BILL；FN
        /// </summary>
        public string applytp { get; set; } = "";
        /// <summary>
        /// 申请单描述（对应账单类别描述）
        /// </summary>
        public string applydesc { get; set; } = "";
        /// <summary>
        /// 收付款客户id
        /// </summary>
        public int cusid { get; set; }
        /// <summary>
        /// 收付款客户名称
        /// </summary>
        public string cusnm { get; set; } = "";
        /// <summary>
        /// 申请单金额
        /// </summary>
        public string amt_apply { get; set; } = "";
        /// <summary>
        /// 所属账单合计金额
        /// </summary>
        public string amt_total { get; set; } = "";
        /// <summary>
        /// 所属账单预结金额
        /// </summary>
        public string amt_pre { get; set; } = "";
        /// <summary>
        /// 所属账单已结金额
        /// </summary>
        public string amt_settled { get; set; } = "";
        /// <summary>
        /// 处理方式：R；P
        /// </summary>
        public string hdltp { get; set; } = "";
        /// <summary>
        /// 处理方式说明
        /// </summary>
        public string hdltpnm { get; set; } = "";
        /// <summary>
        /// 备注信息
        /// </summary>
        public string remark { get; set; } = "";
        /// <summary>
        /// 申请人
        /// </summary>
        public string creator { get; set; } = "";
        /// <summary>
        /// 提交日期
        /// </summary>
        public string submitdt { get; set; } = "";
        /// <summary>
        /// 审批顺序号
        /// </summary>
        public int sortval { get; set; }
        /// <summary>
        /// 账单id，因业务需要，审批单需根据此项获取【账单】明细，无论当前审批的是账单还是结算单
        /// </summary>
        public int billid { get; set; }
        //审批流程****
        //业务详情****
    }

    /// <summary>
    /// 审批结果提交请求
    /// </summary>
    public class ReqRevSubmit : BaseWxUserRequest
    {
        /// <summary>
        /// 申请单id
        /// </summary>
        [Required(ErrorMessage = "申请单id是必需的")]
        public int applyid { get; set; }
        /// <summary>
        /// 申请单类别
        /// </summary>
        [Required(ErrorMessage = "申请单类别是必需的")]
        public string applytp { get; set; } = "";
        /// <summary>
        /// 审批序号
        /// </summary>
        [Required(ErrorMessage = "审批序号是必需的")]
        public int sortval { get; set; }
        /// <summary>
        /// 审批结果：Y-同意；D-拒绝
        /// </summary>
        [Required(ErrorMessage = "审批结果是必需的")]
        public string revlb { get; set; }
        /// <summary>
        /// 拒绝理由
        /// </summary>
        [RequiredConditional("revlb", "D", ErrorMessage = "审批拒绝时必须填写理由")]
        public string reason { get; set; }
    }

    /// <summary>
    /// 用户绑定操作请求
    /// </summary>
    public class ReqBindMember : BaseWxUserRequest
    {
        /// <summary>
        /// 操作标识符
        /// </summary>
        [Required(ErrorMessage = "操作标识符是必需的")]
        public string optlb { get; set; } = "";
        /// <summary>
        /// 用户id
        /// </summary>
        [RequiredConditional("optlb","I",ErrorMessage ="用户id是必需的")]
        public string userid { get; set; } = "";
        /// <summary>
        /// 用户密码
        /// </summary>
        [RequiredConditional("optlb", "I", ErrorMessage = "用户密码是必需的")]
        public string password { get; set; } = "";
        /// <summary>
        /// 系统id
        /// </summary>
        [RequiredConditional("optlb", "D", ErrorMessage = "系统id是必需的")]
        public string memberid { get; set; } = "";
    }

    /// <summary>
    /// 已绑定用户列表结果集
    /// </summary>
    public class ResultBindMember : BaseResultInfo
    {
        /// <summary>
        /// 已绑定用户列表
        /// </summary>
        public List<SysUserInfo> memberlist { get; set; } = new List<SysUserInfo>();
    }

}